[#ftl]
[#compress]
[#include "util10.ftl"/]
[#include "styleMixin.ftl"/]
[/#compress]
 <!DOCTYPE html>
 <html>	
 <head>
 	<title>Beyond Prototype</title>
 	<meta name="title" content="Beyond Prototype">
 	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
 	<style type="text/css">
 		@import "/dojo10/dojo/resources/dojo.css";
 		@import "/dojo10/dojo/resources/dnd.css";		
 		@import "/dojo10/dojox/layout/resources/ResizeHandle.css";
 		@import "/dojo10/dijit/themes/claro/claro.css";
 		@import "/dojo10/dojox/grid/resources/claroGrid.css";		
 	</style> 
 	<script type="text/javascript">
 	 var dojoConfig = {parseOnLoad:false,isDebug:false}; 	
 	</script> 
 	<script src="/dojo10/dojo/dojo.js"></script>
 	<script type="text/javascript">	 		
	 	require({async:false},["dojo/_base/lang","dojo/ready","dojo/parser","dojo/query","dojo/dom-attr","dojo/_base/window","dojo/dom-construct","dojo/json","dojo/has", "dojo/sniff","dijit/form/SimpleTextarea","dijit/form/TextBox"]
	 	,function(lang,ready,parser,query,attr,_win,construct,json,has,sniff,SimpleTextarea,TextBox){				
	 		var str = arguments.callee.toString().replace(/\n*/g,"").replace(/\s*/g,"");
	 		 var args = str.substring(str.indexOf("(") + 1,str.indexOf(")")).split(",");
	 		 for(var i = args.length - 1; i >= 0; i--){
	 			 window[args[i]] = arguments[i];
	 		 }
	 	});
 			 	
	 	[#assign sshuffledCode]
	 	[@shrinksafe key="shome" cached=false shrink=true]	 	
	 	require({async:false},["dijit/_WidgetBase"],function(widget){lang.extend(widget,{
	 		[@styleMixin/]
			,keyframes:null
			,_setKeyframesAttr:function(keyframes){
//				console.log(this.declaredClass,"[_WidgetBase]keyframes=",keyframes);
				for(var name in keyframes){
					this.addDynamicStyleRule(this.keyframes2String(name,keyframes[name]));
				}
			}	
	 	})});
	 	
 		ready(function(){
 			query(".metadata",_win.body()).forEach(function(node){
 				if(node.innerText){
 					var metadata = json.parse(node.innerText,false); 					
 					_win.body().style.cssText = metadata.style;
 					if(metadata.title){
 						document.title = metadata.title;
 					}
 				}
 			});
 			
 			var mids = {};
 			query("[dojotype]",_win.body()).forEach(function(node){
 				mids[attr.get(node,"dojotype").replace(/\./g,"/")] = "";
 			});
 			query("[data-dojo-type]",_win.body()).forEach(function(node){	
 				mids[attr.get(node,"data-dojo-type").replace(/\./g,"/")] = "";
 			});
 			for(var mid in mids){				
 				var name = mid.substring(mid.lastIndexOf("/") + 1);
 				require({async:false},mid,function(widget){
 					_win[name] = widget;
 				});					
 			}
 			parser.parse(_win.body());
 		});
 		[/@][/#assign]
 		${sshuffledCode?replace("\n","")}
 	</script>				
 </head>
 <body class="claro"></body>
 </html>
